﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Diagnostics;

namespace NTweet.HttpService {
	public class HttpRequestFactory : IHttpRequestFactory {
		public IHttpRequest CreateRequest(string uri) {
			Debug.WriteLine("Create Request: " + uri, "HTTP");
			return new HttpRequest((HttpWebRequest)WebRequest.Create(uri));
		}

		public IHttpRequest CreateRequest(string uri, ICredentials credentials) {
			var request = CreateRequest(uri);
			request.Credentials = credentials;
			return request;
		}

		public ICredentials DefaultCredentials { get; set; }
		public CookieContainer DefaultCookieContainer { get; set; }
	}
}
